home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 11486 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.8 KB

  1. Path: EU.net!sun4nl!ittpub!ittpub!nntp
  2. Newsgroups: comp.lang.c++
  3. Subject: Re: Question about exemplars
  4. Message-ID: <1996Mar14.134634.1806@ittpub>
  5. From: wil@ittpub.nl (Wil Evers)
  6. Date: 14 Mar 96 13:46:33 WET
  7. References: <31475C8B.41C6@corp.sgi.com>
  8. Distribution: world
  9. Nntp-Posting-Host: lintilla
  10.  
  11. In article <31475C8B.41C6@corp.sgi.com> Vishwanath Raman  
  12. <vish@corp.sgi.com> writes:
  13.  
  14. > I am building a message library using Exemplars. I write objects from a
  15. > given class hierarchy into a buffer ( contiguously ) and then send the
  16. > buffer accross to a server/peer. I bring the objects back to 'life' by
  17. > invoking a virtual MakeObject method defined through the hierarchy.
  18. > The problem is in trying to regenerate a message when the compilers used
  19. > in creating the client/peer and server/peer programs are DIFFERENT.
  20. > This I assume is because of the way VTable pointers are stored within
  21. > the class address space.
  22. > Any ideas to overcome this problem. Exemplars constitute a cool way of
  23. > regenerating hierarchy objects without parsing...
  24. > A standardisation for the way class objects are stored in memory seems
  25. > to be in order???
  26. > Thanks a mill for any feedback in advance, Vish
  27.  
  28. This is a dead end. In C++, the only portable way to bring streamed  
  29. objects back to life is:
  30.  
  31. (1)    Determine which constructor to call.
  32. (2)    Determine the arguments to the constructor.
  33. (3)    Call the constructor.
  34.  
  35. Of course, an examplar object may be able to do part of that for you, but  
  36. the bottom line is that any other method is platform- and/or  
  37. compiler-specific.
  38.  
  39. You can probably figure out yourself what that would mean if this to be  
  40. done across different platforms/compilers: both sides will have to agree  
  41. on the exact format of the data in the stream.
  42.  
  43. Hope this helps,
  44.  
  45. - Wil 
  46.  
  47.